|
|
|
|
|
|
|
4. Specify the physical directory (which you can find with the Browse button) and the virtual directory (also known as the alias). For your sample, enter /test as the alias for the new directory. |
|
|
|
|
|
|
|
|
5. The next step is to set the appropriate permissions for the new directory. You should see several choices available: |
|
|
|
 |
|
|
|
|
Read permission allows users to read files from the virtual directory. In general, you should enable this permission on all of your virtual directories. |
|
|
|
 |
|
|
|
|
Script permission means that scripts can be executed from the virtual directory. You need to check this option if you intend to use ASP files in the directory. |
|
|
|
 |
|
|
|
|
Execute permission is script permission plus the ability to execute other programs. (Script permission was not a separate choice in IIS 3.0). |
|
|
|
 |
|
|
|
|
Write permission allows users to upload files to a directory. |
|
|
|
|
|
|
|
|
For this sample directory, you need to enable Read and Script permissions. (If you are using IIS 3.0, enable Read and Execute permissions.) |
|
|
|
|
|
|
|
|
6. Press OK to close the new directory window. You are now ready to begin placing ASP files in the directory. |
|
|
|
|
CAUTION
|
|
|
|
|
Because ASP code executes on your server, think very carefully about directory permissions. If you give a virtual directory Write and Execute permission, potentially anyone on the Internet could upload his own .ASP file and execute it on your servera very dangerous situation! |
|
|
|
|
|
|
|
|
|
|
That's it! Now that you have created the /test virtual directory, you can place ASP files in it and execute them from a browser. You create your first sample ASP file and use it with the /test virtual directory later in the section "Creating a Simple ASP File." |
|
|
|
|
|
|
|
|
Applications and Sessions |
|
|
|
|
|
|
|
|
When designing a Web site, directory layout is important from an organizational standpoint, but with Active Server Pages it becomes even more important because the virtual directories represent applications. In our previous example, the /test directory and the files contained within it are considered to be an ASP application. Subdirectories underneath virtual directories are also part of the application. For example, if you use Windows Explorer to create a subdirectory underneath the /test directory, then the new directory is part of the test application. |
|
|
|
|
|
|
|
|
When a user first accesses any page in an application, he initiates a new session with the application. As long as the user stays within the same application and keeps loading Web pages, he is "in" the same session. However, if the user jumps to another application, closes the browser, or stops browsing for an extended period of time then the Web server ends the session. |
|
|
|
|
|
|
|
|
Why are these semantics important? As you will see, Active Server Pages contain objects and events that allow you to maintain state within a session. In other words, you can store session- and application-specific information on the server and share it between multiple ASP files. |
|
|
|
|
|